<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
  <script src="https://cdn.bootcss.com/vue-router/3.1.3/vue-router.min.js"></script>
  <style>
    body {
      background-color: #ccc;
    }

    #app {
      width: 400px;
      margin: 20px auto;
      background-color: #fff;
      border: 4px solid blueviolet;
      border-radius: 1em;
      box-shadow: 3px 3px 3px rgba(0, 0, 0, .5);
      padding: 1em 2em 2em;
    }

    h3 {
      text-align: center;
    }

    .title {
      display: flex;
      justify-content: space-between;
      align-items: center;
      border: 1px solid #ccc;
      padding: 0 1em;
    }

    .title h4 {
      line-height: 2;
      margin: 0;
    }

    .container {
      border: 1px solid #ccc;
      padding: 0 1em;
    }

    .btn {
      /* 鼠标改成手的形状 */
      cursor: pointer;
    }

    .router-link-active {
      color: pink;
      font-size: 30px;
    }
  </style>
</head>

<body>
  <div id="app">
    <nav>
      <ul>
        <li>
          <router-link to="/index">主页</router-link>
        </li>
        <li>
          <router-link to="/add">添加</router-link>
        </li>
        <li>
          <router-link to="/seq/16">查询16号</router-link>
          <router-link to="/seq/18">查询18号</router-link>
        </li>
      </ul>
    </nav>
    <router-view></router-view>
    <script>
      const router = new VueRouter({
        routes: [
          { path: '/index', component: { template: `<div>我是spa的主页，有什么可以帮助你的吗？</div>` } },
          { path: '/add', component: { template: `<div>咋样啊哥，加个钟吗？</div>` } },
          { path: '/seq/:id', component: { template: `<div>还想要谁，我给你找？{{$route.params.id}}</div>` } }
        ]
      })

      const vm = new Vue({
        el: '#app',
        router: router
      })
    </script>
</body>

</html>